﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace eNew.ConsoleApps.ImportTxtToSQL.BusinessEntities
{
    using ResourceAccess;
    class ImportData
    {
        string _AgentAgencyAccount = string.Empty;
        string _PayeeName = string.Empty;
        string _Bank = string.Empty;
        string _AccountNumber = string.Empty;
        string _Type = string.Empty;
        string _Amount = string.Empty;
        string _EndingDate = string.Empty;

        #region Properties

        public string AgentAgencyAccount
        {
            get { return _AgentAgencyAccount; }
            set { _AgentAgencyAccount = value; }

        }

        public string PayeeName
        {
            get { return _PayeeName; }

            set { _PayeeName = value; }

        }

        public string Bank
        {
            get { return _Bank; }
            set { _Bank = value; }
        }

        public string AccountNumber
        {
            get { return _AccountNumber; }
            set { _AccountNumber = value; }
        }

        public string Type
        {
            get { return _Type; }
            set { _Type = value; }
        }

        public string Amount
        {
            get { return _Amount; }
            set { _Amount = value; }
        }

        public string EndingDate
        {
            get { return _EndingDate; }
            set { _EndingDate = value; }
        }

        #endregion

        public ImportData() { }

        public ImportData(string line)
        {
            //Each line have 89 columns


            this.EndingDate = line.Substring(0, 11).Trim();
            this.AgentAgencyAccount = line.Substring(11, 11).Trim();
            this.PayeeName = line.Substring(24, 21).Trim();
            this.Bank = line.Substring(46, 10).Trim();
            this.AccountNumber = line.Substring(57, 14).Trim();
            this.Type = line.Substring(72, 12).Trim();
            this.Amount = line.Substring(85);

        }




    }
}
